package nongchang.kuaijiecaifu.com.ncapp_android.ui.gamerulefragment;

import android.os.Bundle;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;
import nongchang.kuaijiecaifu.com.ncapp_android.R;
import nongchang.kuaijiecaifu.com.ncapp_android.common.fragment.BaseFragment;
import nongchang.kuaijiecaifu.com.ncapp_android.retrofit.good.Calculate;
import nongchang.kuaijiecaifu.com.ncapp_android.ui.adapter.CalculateAdapter;

/**
 * Created by Administrator on 2016/6/3 0003.
 */

/**
 * Created by Administrator on 2016/3/11 0011.
 */
public class GameRule2Fragment extends BaseFragment {
    @BindView(R.id.list)
    RecyclerView mListView;
    private CalculateAdapter mAdapter;
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        View view = inflater.inflate(R.layout.fragment_game_rule2, container, false);
        return view;
    }
    @Override
    public void onViewCreated(View view, Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        ButterKnife.bind(this, getView());
        mAdapter=new CalculateAdapter(getContext());
        mListView.setAdapter(mAdapter);
        load();
    }

    private void load() {
        Calculate item=new Calculate();
        item.name="哇哈哈";
        item.number=52101314;
        item.time=1464922511;
        List<Calculate> list=new ArrayList<>();
        for(int i=0;i<100;i++){
            list.add(item);
        }
        mAdapter.update(list);
    }
}
